<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title><?php echo $this->_lang['login']; ?> - <?php echo $this->_lang['site_title']; ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="<?php echo $_config['url']['css']; ?>base.css" rel="stylesheet" type="text/css">
  <script type="text/javascript">
  <!--
	function check_login_form()
	{
		var f = document.getElementById('f1');
		if( f.email.value == '' )
		{
			alert('<?php echo $this->_lang['email_not_empty']; ?>');
			f.email.focus();
			return false;
		}

		if( ! isValidEmail(f.email.value) || f.email.value.length > 30 || f.email.value.length < 6)
		{
			alert('<?php echo $this->_lang['email_wrong_format']; ?>');
			f.email.focus();
			return false;
		}

		if( f.password.value == '' )
		{
			alert('<?php echo $this->_lang['password_not_empty']; ?>');
			f.password.focus();
			return false;
		}
		else
		{
			if( f.password.value.length > 15 || f.password.value.length < 6 )
			{
				alert('<?php echo $this->_lang['password_wrong_format']; ?>');
				f.password.focus();
				return false;
			}
		}

		f.submit.disabled = true;
		return true;
	}

	function isValidEmail(str)
	{
		return (str.indexOf(".") >= 1) && (str.indexOf("@") > 0) && str.indexOf(".") != str.length-1;
	}

	function check_reg_form()
	{
		var f = document.getElementById('f2');
		if( f.email.value == '' )
		{
			alert('<?php echo $this->_lang['email_not_empty']; ?>');
			f.email.focus();
			return false;
		}

		if( ! isValidEmail(f.email.value) || f.email.value.length > 30 || f.email.value.length < 6)
		{
			alert('<?php echo $this->_lang['email_wrong_format']; ?>');
			f.email.focus();
			return false;
		}

		if( f.password.value == '' )
		{
			alert('<?php echo $this->_lang['password_not_empty']; ?>');
			f.password.focus();
			return false;
		}
		else
		{
			if( f.password.value.length > 15 || f.password.value.length < 6 )
			{
				alert('<?php echo $this->_lang['password_wrong_format']; ?>');
				f.password.focus();
				return false;
			}
		}

		if( f.password2.value == '' )
		{
			alert('<?php echo $this->_lang['repeat_password_not_empty']; ?>');
			f.password2.focus();
			return false;
		}
		else
		{
			if( f.password2.value.length > 15 || f.password2.value.length < 6 )
			{
				alert('<?php echo $this->_lang['repeat_password_wrong_format']; ?>');
				f.password2.focus();
				return false;
			}
		}

		if( f.password.value != f.password2.value )
		{
			alert('<?php echo $this->_lang['two_password_not_match']; ?>');
			f.password.focus();
			return false;
		}

		f.submit.disabled = true;
		return true;
	}

  //-->
  </script>
 </head>

 <body>
 <div id="mask">
<?php echo $layout_header; ?>
<div style="padding:60px;width:70%;margin:0px auto;">
<div style="float:left;width:40%;">
 <h3 style="text-align:center;padding-bottom:5px;"><?php echo $this->_lang['login']; ?></h3>
	<table border="0"  align="center" cellpadding="0" cellspacing="0">
		<form id="f1" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>" onSubmit="javascript:return check_login_form();">
		<input type="hidden" name="referer" id="referer" value="<?php echo $referer; ?>">
		<tr>
				<td style="background-color:#CCCCCC"><table id="innerTable" border="0" width="100%" align="center" cellpadding="5" cellspacing="1">
			<tr>
				<td width="70" style="background-color:#FFFFFF;"><?php echo $this->_lang['email']; ?><?php echo $this->_lang['colon']; ?></td>
				<td style="background-color:#FFFFFF;"><input type="text" name="email" id="email" maxlength="30"/> *</td>
			</tr>
			<tr>
				<td style="background-color:#FFFFFF;"><?php echo $this->_lang['password']; ?><?php echo $this->_lang['colon']; ?></td>
				<td style="background-color:#FFFFFF;"><input type="password" name="password" id="password" maxlength="15" /> *</td>
			</tr>
			<tr>
				<td style="background-color:#FFFFFF;">&nbsp;</td>
				<td style="background-color:#FFFFFF;"><input type="submit" name="submit" id="submit" value="<?php echo $this->_lang['login']; ?>" /></td>
			</tr>
		</table>
		</td>
		</tr>
		</form>
	</table>
</div>

<div style="margin:0px;float:right;width:55%;">
 <h3 style="text-align:center;padding-bottom:5px;"><?php echo $this->_lang['register']; ?></h3>
	<table border="0" align="center" cellpadding="0" cellspacing="0">
		<form id="f2" method="post" action="register.php" onSubmit="javascript:return check_reg_form();">
		<input type="hidden" name="referer" id="referer" value="<?php echo $referer; ?>">
		<tr>
				<td style="background-color:#CCCCCC"><table id="innerTable" border="0" width="100%" align="center" cellpadding="5" cellspacing="1">
			<tr>
				<td width="70" style="background-color:#FFFFFF;"><?php echo $this->_lang['email']; ?><?php echo $this->_lang['colon']; ?></td>
				<td style="background-color:#FFFFFF;"><input type="text" name="email" id="email" maxlength="30"/> *<?php echo $this->_lang['email_format']; ?></td>
			</tr>
			<tr>
				<td style="background-color:#FFFFFF;"><?php echo $this->_lang['password']; ?><?php echo $this->_lang['colon']; ?></td>
				<td style="background-color:#FFFFFF;"><input type="password" name="password" id="password" maxlength="15" /> *<?php echo $this->_lang['password_format']; ?></td>
			</tr>
			<tr>
				<td style="background-color:#FFFFFF;"><?php echo $this->_lang['repeat_password']; ?><?php echo $this->_lang['colon']; ?></td>
				<td style="background-color:#FFFFFF;"><input type="password" name="password2" id="password2" maxlength="15"/> *</td>
			</tr>
			<tr>
				<td style="background-color:#FFFFFF;">&nbsp;</td>
				<td style="background-color:#FFFFFF;"><input type="submit" name="submit" id="submit" value="<?php echo $this->_lang['register']; ?>" /></td>
				</tr>
			</table>
			</td>
			</tr>
			</form>
	</table>
</div>
</div>
<?php echo $layout_footer; ?>
</div>
</body>
</html>
